import request from '@/utils/request'

export const getDepartments = function() {
  return request({
    url: '/company/department'
  })
}

export const delDepartments = function(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

export const addDepartments = function(from) {
  return request({
    method: 'post',
    url: '/company/department',
    data: from
  })
}

export const getCompanyDepartment = function(id) {
  return request({
    url: '/company/department/' + id
  })
}
export function updateDepartments(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
